using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;


namespace Acms.SqlDal
{
    public class UserPostVoteTotalDal : Base
    {
        public enum Fields
        {
            PostGuid,
            Score,
            Total
        }

        protected override void ReadRecord(Hashtable table, SqlDataReader reader)
        {
            GetReaderValue<Guid>(Fields.PostGuid, reader, table);
            GetReaderValue<decimal>(Fields.Score, reader, table);
            GetReaderValue<int>(Fields.Total, reader, table);
        }

        public Hashtable[] GetAllByPostGuid(Guid postGuid)
        {
            SqlCommand cmd = CreateCommand("GetAllByPostGuid");
            AddInputParameter(cmd, "PostGuid", postGuid, SqlDbType.UniqueIdentifier);
            return ExecuteGetCollection(cmd);
        }
    }
}
